<?php

// 全局变量规则
Route::pattern([
    'page' => '\d+',
    'id' => '\d+',
    'cateid' => '\d+',
    'filename' => '[a-z0-9\-]+',
    'catename' => '[a-z0-9\-]+',
]);

// 后台
Route::get('admin', '/admin.php');

// API接口
Route::group('api', [
    ':controller/:action' => 'api/:controller/:action',
    ':controller' => 'api/:controller/index',
    '' => 'api/Index/index',
]);
